import request from '@/utils/request'

// const api_name = '/admin/edu/teacher'
export default {
  getPageList(page, limit, searchObj) {
    return request({
      url: `/admin/edu/teacher/list/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  removeById(id) {
    return request({
      url: `/admin/edu/teacher/remove`,
      method: 'delete',
      params: { id: id }
    })
  },
  save(teacher) {
    return request({
      url: `/admin/edu/teacher/save`,
      method: 'post',
      data: teacher
    })
  },
  getById(id) {
    return request({
      url: `/admin/edu/teacher/get/` + id,
      method: 'get'
    })
  },
  getList() {
    return request({
      url: `/admin/edu/teacher/list`,
      method: 'get'
    })
  },
  updateById(teacher) {
    return request({
      url: `/admin/edu/teacher/update`,
      method: 'put',
      data: teacher
    })
  },
  remove(fileUrl) {
    return request({
      url: `/api/oss/file/remove`,
      method: 'delete', //delete请求的格式比较特别
      params: { url: fileUrl }
    })
  }
}
